<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>设置团长佣金</title>

    <link href="{__FRAME_PATH}/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
    <link href="{__ADMIN_PATH}/css/layui-admin.css" rel="stylesheet">
    <link href="{__FRAME_PATH}/css/style.min.css?v=3.0.0" rel="stylesheet">
    <link href="{__FRAME_PATH}css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
    <script src="{__PLUG_PATH}vue/dist/vue.min.js"></script>
    <link href="{__PLUG_PATH}iview/dist/styles/iview.css" rel="stylesheet">
    <script src="{__PLUG_PATH}iview/dist/iview.min.js"></script>
    <script src="{__PLUG_PATH}jquery/jquery.min.js"></script>
    <script src="{__PLUG_PATH}form-create/province_city.js"></script>
    <script src="{__PLUG_PATH}form-create/form-create.min.js"></script>
    <link href="{__PLUG_PATH}layui/css/layui.css" rel="stylesheet">
    <script src="{__PLUG_PATH}layui/layui.all.js"></script>
    <style>
        /*弹框样式修改*/
        .ivu-modal{top: 20px;}
        .ivu-modal .ivu-modal-body{padding: 10px;}
        .ivu-modal .ivu-modal-body .ivu-modal-confirm-head{padding:0 0 10px 0;}
        .ivu-modal .ivu-modal-body .ivu-modal-confirm-footer{display: none;padding-bottom: 10px;}
        .ivu-date-picker {display: inline-block;line-height: normal;width: 280px;}
        .ivu-modal-footer{display: none;}
        .ivu-poptip-popper{text-align: left;}
        .ivu-icon{padding-left: 5px;}
        .ivu-btn-long{width: 10%;min-width:100px;margin-left: 18%;}
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>系统配置</h5>
                </div>
                <div class="tabs-container ibox-title">
                    <ul class="nav nav-tabs">
                        设置团长佣金(为团员每个订单总金额的佣金;默认为0)
                    </ul>

                    <div class="ibox-content">
                        <form class="layui-form" action="">
                            <div class="layui-form-item">
                                <label class="layui-form-label">佣金</label>
                                <div class="layui-input-block">
                                    <input type="text" name="yj" required value="{$yj}"  lay-verify="required" placeholder="(例如 1% 请输入0.1; 20% 请输入 0.2)" autocomplete="off" class="layui-input">
                                    (例如 1% 请输入0.01; 10% 请输入 0.1)
                                </div>
                            </div>
                            
                            <div class="layui-form-item">
                                <label class="layui-form-label">上级团长佣金</label>
                                <div class="layui-input-block">
                                    <input type="text" name="sjyj" required value="{$sjyj}"  lay-verify="required" placeholder="(例如 1% 请输入0.1; 20% 请输入 0.2)" autocomplete="off" class="layui-input">
                                    (例如 1% 请输入0.01; 10% 请输入 0.1)
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                </div>
                            </div>
                        </form>

                        <script>
                            //Demo
                            layui.use('form', function(){
                                var form = layui.form;

                                //监听提交
                                form.on('submit(formDemo)', function(data){
                                    // layer.msg(JSON.stringify(data.field));
                                    // exit();
                                    var edityj = data.field.yj;
                                    var editsjyj = data.field.sjyj;
                                    var url = "/admin/user.tzuser/yj_edit";
                                    $.get(url,{yj:edityj,sjyj:editsjyj},function(res){
                                        var data = (JSON.parse(res));
                                        if(data.code == 200){
                                            layer.msg('修改成功',{icon: 1});
                                            return;
                                        }else {
                                            layer.msg('修改失败',{icon: 5});
                                            return;
                                        }
                                    })
                                    return false;
                                });
                            });
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>


</html>